#/bin/env python
# Do everything properly, and componentize

import test_pb2

a = test_pb2.Book()
a.book_name = "book write by xiong"
a.author = "xiong"
dd = a.SerializeToString()
ss = str(len(dd))+a.SerializeToString() + "\r\n"
print len(dd)
print len(ss)

b = test_pb2.Book()
b.ParseFromString(ss[2:-2])
print b.book_name
print b.author



